Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude the action name only not the full uses in actions_check_pinned_tags #95

Closed
wants to merge 1 commit into from

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Apr 15, 2024

Our example profiles exclude just the action name because that's what
frizbee uses internally to exclude:
https://github.com/stacklok/minder-rules-and-profiles/blob/main/profiles/github/stacklok-health-check.yaml#L29

But the rego check in the actions_check_pinned_tags rule was excluding
on the full value of uses. This meant that the remediation was always
called even if it didn't produce anything and the exclude didn't work.

…d_tags

Our example profiles exclude just the action name because that's what
frizbee uses internally to exclude:
https://github.com/stacklok/minder-rules-and-profiles/blob/main/profiles/github/stacklok-health-check.yaml#L29

But the rego check in the actions_check_pinned_tags rule was excluding
on the full value of uses. This meant that the remediation was always
called even if it didn't produce anything and the exclude didn't work.
@jhrozek
Copy link
Contributor Author

jhrozek commented Apr 15, 2024

gonna reopen this from a branch from origin to make sure tests run

@jhrozek jhrozek closed this Apr 15, 2024
# Split the uses directive at '@'
parts := split(s.uses, "@")

# Skip if the action name is part of excludes
not is_excluded(parts[0], input.profile.exclude)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add an or statement checking the case where the tag is used in the excludes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants